<?php

use think\migration\Migrator;
use think\migration\db\Column;

class CmClients extends Migrator
{
    public function change()
    {
        $table = $this->table('cm_clients', ['auto_increment' => true, 'limit' => 10, 'signed' => false]);
        $table->addColumn('name', 'string', ['limit' => 30, 'default' => '', 'comment' => '名称'])
            ->addColumn('code', 'string', ['limit' => 3, 'default' => '', 'comment' => '客户端编号'])
            ->addColumn('describe', 'string', ['limit' => 150, 'default' => '', 'comment' => '说明'])
            ->addColumn('is_delete', 'integer', ['limit' => 10, 'default' => 0, 'signed' => false, 'comment' => '是否删除 0:否 非0:是'])
            ->addIndex(['code', 'is_delete'], ['type' => 'unique'])
            ->create();
    }
}
